package fileSearchSystem;

import org.eclipse.swt.widgets.Table;

/**
 * This class (part of the MVC structure) calls the model function that
 * will update table tags 
 */
public class updateExecuter 
{
	Table tags;
	SearchParser sp = SearchParser.getInstance();
	static private updateExecuter instance = null;
	//for singleton
	private static Object someObject = new Object();
	
	private updateExecuter(){}
	
	static public updateExecuter getInstance() 
	{
		if(null == instance) 
		{
			//to insure that the time slice doesn't cause to creation of 2 instances
			synchronized (someObject) 
			{
				if (null == instance)
					instance = new updateExecuter();
			}
		}
	    return instance;
	}
	
	/**
	 * Update the table tags with the current DB tags
	 */

	public void execute()
	{
		sp.update(tags);
	}

	public void setTags(Table tags)
	{
		this.tags = tags;
	}
}
